import React, { useState, useEffect } from "react";
import { useNavigate, useParams, useLocation } from "react-router-dom";
import Header from "../Header"
import "./index.less";
import img1 from "@/assets/images/img1.png";
import img2 from "@/assets/images/img2.png";
import notice from "@/assets/images/notice.png";
import { Modal } from "antd";
import { useTranslation, Trans } from "react-i18next";

const Frame = (props) => {
  const loadtion = useLocation();
  const navigate = useNavigate();
  const [isModalOpen, setIsModalOpen] = useState(false);
  const { t, i18n } = useTranslation();

  // 选中的菜单
  useEffect(() => {
    console.log(loadtion);
    window.scrollTo(0, 0);
  }, [loadtion]);
  const handleOk = () => {
    setIsModalOpen(false);
  };
  const handleCancel = () => {
    setIsModalOpen(false);
  };
  const goUrl = () => {
    window.location.href = "https://www.rwadeai.com/"
  }
  return (
    <div className="page">
      <Header />
      <div>{props.children}</div>
      <Modal title={""} width={800} className="modal_box" centered open={isModalOpen} onOk={handleOk} onCancel={handleCancel} footer={null}>
        <div class="tips_box_new">
          <div className="title">{t("notice2")}</div>
          <div className="tit">{t("notice1")}</div>
          <div className="img_box">
                      <img className="notice" src={notice} alt="" />

          </div>
        </div>
      </Modal>
    </div>
  );
};
export default Frame;
